package com.ruoyi.eduManage.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.eduManage.domain.EduComment;
import com.ruoyi.eduManage.mapper.EduCommentMapper;
import com.ruoyi.eduManage.service.IEduCommentService;
import com.ruoyi.common.core.text.Convert;
import com.ruoyi.common.utils.DateUtils;

@Service
public class EduCommentServiceImpl implements IEduCommentService {

    @Autowired
    private EduCommentMapper eduCommentMapper;

    @Override
    public EduComment selectEduCommentByCommentId(Long commentId) {
        return eduCommentMapper.selectEduCommentByCommentId(commentId);
    }

    @Override
    public List<EduComment> selectEduCommentList(EduComment eduComment) {
        return eduCommentMapper.selectEduCommentList(eduComment);
    }

    @Override
    public int insertEduComment(EduComment eduComment) {
        eduComment.setCreateTime(DateUtils.getNowDate());
        return eduCommentMapper.insertEduComment(eduComment);
    }

    @Override
    public int updateEduComment(EduComment eduComment) {
        eduComment.setUpdateTime(DateUtils.getNowDate());
        return eduCommentMapper.updateEduComment(eduComment);
    }

    @Override
    public int deleteEduCommentByCommentIds(String[] commentIds) {
        return eduCommentMapper.deleteEduCommentByCommentIds(commentIds);
    }

    @Override
    public int deleteEduCommentByCommentId(Long commentId) {
        return eduCommentMapper.deleteEduCommentByCommentId(commentId);
    }
}